<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
        <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../jsjar/jquery-3.5.1.min.js"></script>
<script type="text/javascript">
$(function(){
	$(".foodname").click(function(){
		var id=$(this).attr("myid");
		$("#myaaa").load("${pageContext.request.contextPath }/wares/idff?id="+id+"&uid=${fuser.fid}");
		return false;
	});
	$("#sub").click(function(){
		var fname=$("#fname").val();
		$("#myaaa").load("${pageContext.request.contextPath }/wares/spffname?username="+fname+"&id=${fuser.fid}");
		return false;
	});
});
</script>
<style type="text/css">
*{margin:0px; padding:0px;}
#myaaa{width:1049px;margin: auto;height:660px ;border-radius: 10px;margin-top:10px;}
.table1{border:0px solid blue;margin:3px; float:left;}


.li{list-style: none; }
#divtable{width:90%;margin:0 auto;text-align:center;}
#tdli{width:270px;height:128px;}
body{background: #ffffff url("../imgs/2.jpg");background-size:100% 230%;}
#search{width:99%;height:100px; margin:0 auto; position: relative;}
#search div{width:450px; height:99px;padding-top:25px;margin-left:500px;}
#fname{padding-left:10px;;width:300px;height:45px;border-top-left-radius: 10px;border-bottom-left-radius: 10px;border:0.3px solid #87CEFA;}
#sub{border:0; width:85px;height:45px;border-top-right-radius: 8px;border-bottom-right-radius: 8px;background-color:#87CEFA ;color:white;bottom:1px;}
#tr1{border-radius: 10px;border: 0.5px solid black;margin-bottom: 10px; }
</style>
</head>
<body>
<div id="myaaa">
	<form id="search">
		<div>
		<input type="text" name="wname" id="fname" placeholder="请输入想搜索的水果名"><input id="sub" type="submit" value="搜索">
		</div>
	</form> 
	<div id="divtable">
	<c:forEach var="w" items="${wares}">
	<table class="table1">
		<tr id="tr1">
			<td colspan="3"><a class="foodname" myid="${w.wid}" href="#"><img src="../imgs/${w.wphone }"  alt="图片仅供参考" style="width:300px;height:194px;border-radius: 10px;"></a>
			<ul class="li" id="tdli">
			<li>${w.wname }</li>
			<li>¥&nbsp${w.wprice }元</li>
			<li>${w.recommendation }/ 库存:${w.winventory }</li>
			</ul>
			</td>
			
		</tr>
	</table>
	</c:forEach>
	</div>
</div>
</body>
</html>